<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>6 E | Glossary</title>
<meta name="author" content="psyTeachR Team">
<meta name="description" content="6.1 effect code A coding scheme for categorical variables that contrasts each group mean with the mean of all the group means. Also referred to as contrast coding.   6.2 effect size The difference...">
<meta name="generator" content="bookdown 0.24 with bs4_book()">
<meta property="og:title" content="6 E | Glossary">
<meta property="og:type" content="book">
<meta property="og:url" content="https://psyteachr.github.io/glossary/e.html">
<meta property="og:image" content="https://psyteachr.github.io/glossary/images/logos/logo.png">
<meta property="og:description" content="6.1 effect code A coding scheme for categorical variables that contrasts each group mean with the mean of all the group means. Also referred to as contrast coding.   6.2 effect size The difference...">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="6 E | Glossary">
<meta name="twitter:description" content="6.1 effect code A coding scheme for categorical variables that contrasts each group mean with the mean of all the group means. Also referred to as contrast coding.   6.2 effect size The difference...">
<meta name="twitter:image" content="https://psyteachr.github.io/glossary/images/logos/logo.png">
<!-- JS --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://kit.fontawesome.com/6ecbd6c532.js" crossorigin="anonymous"></script><script src="libs/header-attrs-2.11/header-attrs.js"></script><script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="libs/bootstrap-4.6.0/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-4.6.0/bootstrap.bundle.min.js"></script><script src="libs/bs3compat-0.3.1.9000/transition.js"></script><script src="libs/bs3compat-0.3.1.9000/tabs.js"></script><script src="libs/bs3compat-0.3.1.9000/bs3compat.js"></script><link href="libs/bs4_book-1.0.0/bs4_book.css" rel="stylesheet">
<script src="libs/bs4_book-1.0.0/bs4_book.js"></script><script src="libs/kePrint-0.0.1/kePrint.js"></script><link href="libs/lightable-0.0.1/lightable.css" rel="stylesheet">
<!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=G-6NP3MF25W3"></script><script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-6NP3MF25W3');
    </script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- CSS --><link rel="stylesheet" href="include/psyteachr.css">
<link rel="stylesheet" href="include/webex.css">
<link rel="stylesheet" href="include/style.css">
</head>
<body data-spy="scroll" data-target="#toc">

<div class="container-fluid">
<div class="row">
  <header class="col-sm-12 col-lg-3 sidebar sidebar-book"><a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>

    <div class="d-flex align-items-start justify-content-between">
      <h1>
        <a href="index.html" title="">Glossary</a>
      </h1>
      <button class="btn btn-outline-primary d-lg-none ml-2 mt-1" type="button" data-toggle="collapse" data-target="#main-nav" aria-expanded="true" aria-controls="main-nav"><i class="fas fa-bars"></i><span class="sr-only">Show table of contents</span></button>
    </div>

    <div id="main-nav" class="collapse-lg">
      <form role="search">
        <input id="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>

      <nav aria-label="Table of contents"><h2>Table of contents</h2>
        <ul class="book-toc list-unstyled">
<li><a class="" href="index.html">Overview</a></li>
<li><a class="" href="symbols.html"><span class="header-section-number">1</span> Symbols</a></li>
<li><a class="" href="a.html"><span class="header-section-number">2</span> A</a></li>
<li><a class="" href="b.html"><span class="header-section-number">3</span> B</a></li>
<li><a class="" href="c.html"><span class="header-section-number">4</span> C</a></li>
<li><a class="" href="d.html"><span class="header-section-number">5</span> D</a></li>
<li><a class="active" href="e.html"><span class="header-section-number">6</span> E</a></li>
<li><a class="" href="f.html"><span class="header-section-number">7</span> F</a></li>
<li><a class="" href="g.html"><span class="header-section-number">8</span> G</a></li>
<li><a class="" href="h.html"><span class="header-section-number">9</span> H</a></li>
<li><a class="" href="i.html"><span class="header-section-number">10</span> I</a></li>
<li><a class="" href="j.html"><span class="header-section-number">11</span> J</a></li>
<li><a class="" href="k.html"><span class="header-section-number">12</span> K</a></li>
<li><a class="" href="l.html"><span class="header-section-number">13</span> L</a></li>
<li><a class="" href="m.html"><span class="header-section-number">14</span> M</a></li>
<li><a class="" href="n.html"><span class="header-section-number">15</span> N</a></li>
<li><a class="" href="o.html"><span class="header-section-number">16</span> O</a></li>
<li><a class="" href="p.html"><span class="header-section-number">17</span> P</a></li>
<li><a class="" href="q.html"><span class="header-section-number">18</span> Q</a></li>
<li><a class="" href="r.html"><span class="header-section-number">19</span> R</a></li>
<li><a class="" href="s.html"><span class="header-section-number">20</span> S</a></li>
<li><a class="" href="t.html"><span class="header-section-number">21</span> T</a></li>
<li><a class="" href="u.html"><span class="header-section-number">22</span> U</a></li>
<li><a class="" href="v.html"><span class="header-section-number">23</span> V</a></li>
<li><a class="" href="w.html"><span class="header-section-number">24</span> W</a></li>
<li><a class="" href="x.html"><span class="header-section-number">25</span> X</a></li>
<li><a class="" href="y.html"><span class="header-section-number">26</span> Y</a></li>
<li><a class="" href="z.html"><span class="header-section-number">27</span> Z</a></li>
</ul>

        <div class="book-extra">
          <p><a id="book-repo" href="https://github.com/psyteachr/glossary">View book source <i class="fab fa-github"></i></a></p>
        </div>
      </nav>
</div>
  </header><main class="col-sm-12 col-md-9 col-lg-7" id="content"><div id="e" class="section level1" number="6">
<h1>
<span class="header-section-number">6</span> E<a class="anchor" aria-label="anchor" href="#e"><i class="fas fa-link"></i></a>
</h1>

<div id="effect-code" class="section level2" number="6.1">
<h2>
<span class="header-section-number">6.1</span> effect code<a class="anchor" aria-label="anchor" href="#effect-code"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A <a href="c.html#coding-scheme">coding scheme</a> for categorical variables that contrasts each group mean with the mean of all the group means.</dfn></p>
<p>Also referred to as <strong>contrast coding</strong>.</p>

</div>
<div id="effect-size" class="section level2" number="6.2">
<h2>
<span class="header-section-number">6.2</span> effect size<a class="anchor" aria-label="anchor" href="#effect-size"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>The difference between the effect in your data and the null effect (usually a chance value)</dfn></p>

</div>
<div id="effect" class="section level2" number="6.3">
<h2>
<span class="header-section-number">6.3</span> effect<a class="anchor" aria-label="anchor" href="#effect"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>Some measure of your data, such as the <a href="m.html#mean">mean</a> value, or the number of <a href="s.html#standard-deviation">standard deviations</a> the mean differs from a chance value.</dfn></p>

</div>
<div id="element" class="section level2" number="6.4">
<h2>
<span class="header-section-number">6.4</span> element<a class="anchor" aria-label="anchor" href="#element"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>One item in a <a href="v.html#vector">vector</a>.</dfn></p>
<p>For example, the built-in vector <code>LETTERS</code> contains 26 elements: the uppercase latin letters A through Z. You can select an element from a vector by putting its <a href="i.html#index">index</a> in square brackets.</p>
<div class="sourceCode" id="cb98"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># get the tenth upppercase letter</span>
<span class="va">LETTERS</span><span class="op">[</span><span class="fl">10</span><span class="op">]</span>
<span class="co">#&gt; [1] "J"</span></code></pre></div>
</div>
<div id="element-html" class="section level2" number="6.5">
<h2>
<span class="header-section-number">6.5</span> element (html)<a class="anchor" aria-label="anchor" href="#element-html"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A unit of HTML, such as a header, paragraph, or image.</dfn></p>
<p>In <a href="h.html#html">HTML</a>, an element is defined by start and end <a href="t.html#tag">tags</a>. Labelling parts of HTML content as elements defines how they should be visually displayed (controlled by <a href="c.html#css">CSS</a>) and handled by screen readers.</p>

</div>
<div id="ellipsis" class="section level2" number="6.6">
<h2>
<span class="header-section-number">6.6</span> ellipsis<a class="anchor" aria-label="anchor" href="#ellipsis"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>Three dots (...) representing further unspecified <a href="a.html#argument">arguments</a> to a <a href="f.html#function">function</a>.</dfn></p>
<p>When you look up the help for a function, you often see one of the arguments is <code>...</code>. This means that you can supply your own argument names and values here.</p>
<p>For example, the help page for <code><a href="https://rdrr.io/pkg/dplyr/man/mutate.html">dplyr::mutate()</a></code> shows a usage of <code>mutate(.data, ...)</code>, which means that the first argument is called <code>.data</code> and is the data table you want to mutate, and the second argument is <code>...</code>, which means that you can add as many new arguments as you want and each one will create a new column with the argument name and value.</p>
<div class="sourceCode" id="cb99"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># create a data frame with letters and numbers </span>
<span class="va">df</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>
  number <span class="op">=</span> <span class="fl">1</span><span class="op">:</span><span class="fl">5</span>,
  letter <span class="op">=</span> <span class="va">LETTERS</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">5</span><span class="op">]</span>
<span class="op">)</span>

<span class="co"># the mutate function lets you add custom arguments</span>
<span class="co"># like lower and plus_10</span>
<span class="fu"><a href="https://rdrr.io/pkg/dplyr/man/mutate.html">mutate</a></span><span class="op">(</span>
  .data <span class="op">=</span> <span class="va">df</span>,
  lower <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/chartr.html">tolower</a></span><span class="op">(</span><span class="va">letter</span><span class="op">)</span>,
  plus_10 <span class="op">=</span> <span class="va">number</span> <span class="op">+</span> <span class="fl">10</span>
<span class="op">)</span></code></pre></div>
<div class="kable-table">
<div class="inline-table"><table class="table table-sm">
<thead><tr>
<th style="text-align:right;">
number
</th>
<th style="text-align:left;">
letter
</th>
<th style="text-align:left;">
lower
</th>
<th style="text-align:right;">
plus_10
</th>
</tr></thead>
<tbody>
<tr>
<td style="text-align:right;">
1
</td>
<td style="text-align:left;">
A
</td>
<td style="text-align:left;">
a
</td>
<td style="text-align:right;">
11
</td>
</tr>
<tr>
<td style="text-align:right;">
2
</td>
<td style="text-align:left;">
B
</td>
<td style="text-align:left;">
b
</td>
<td style="text-align:right;">
12
</td>
</tr>
<tr>
<td style="text-align:right;">
3
</td>
<td style="text-align:left;">
C
</td>
<td style="text-align:left;">
c
</td>
<td style="text-align:right;">
13
</td>
</tr>
<tr>
<td style="text-align:right;">
4
</td>
<td style="text-align:left;">
D
</td>
<td style="text-align:left;">
d
</td>
<td style="text-align:right;">
14
</td>
</tr>
<tr>
<td style="text-align:right;">
5
</td>
<td style="text-align:left;">
E
</td>
<td style="text-align:left;">
e
</td>
<td style="text-align:right;">
15
</td>
</tr>
</tbody>
</table></div>
</div>

</div>
<div id="environment" class="section level2" number="6.7">
<h2>
<span class="header-section-number">6.7</span> environment<a class="anchor" aria-label="anchor" href="#environment"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A data structure that contains R objects such as variables and functions</dfn></p>
<p>The Environment <a href="p.html#panes">pane</a> defaults to showing the contents of the Global Environment. This is where <a href="o.html#object">objects</a> defined in the <a href="c.html#console">console</a> or interactively running <a href="s.html#script">scripts</a> are stored. You can also use the code <code><a href="https://rdrr.io/r/base/ls.html">ls()</a></code> to list all objects.</p>
<p>When you restart R, the global environment should clear. If it doesn't, go to <strong><code>Global Options...</code></strong> under the Tools menu (⌘,), and uncheck the box that says Restore .RData into workspace at startup. If you keep things around in your workspace, things will get messy, and unexpected things will happen. You should always start with a clear workspace. This also means that you never want to save your workspace when you exit, so set this to Never. The only thing you want to save are your scripts.</p>
<p>You can also use the code <code>rm(list = ls())</code> or click on the broom icon in the Environment pane to clear the global environment without restarting R.</p>
<p>When you <a href="k.html#knit">knit</a> an <a href="r.html#r-markdown">R markdown</a> file, this happens in a new environment, so if any of your code relies on objects you created outside your script, that code will run interactively in R Studio, but will fail when you knit because the objects in the gloabl environment are not available in the knitting environment.</p>
<p>If you start writing your own functions, you need to understand a little about <a href="s.html#scope">scope</a> and how the environment inside a function is not the same as the global environment. The <a href="http://adv-r.had.co.nz/Environments.html" target="_blank">Environments chapter</a> in Advanced R is a good resource for advanced understanding.</p>

</div>
<div id="error-term" class="section level2" number="6.8">
<h2>
<span class="header-section-number">6.8</span> error term<a class="anchor" aria-label="anchor" href="#error-term"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>The term in a model that represents the difference between the actual and predicted values</dfn></p>

</div>
<div id="error" class="section level2" number="6.9">
<h2>
<span class="header-section-number">6.9</span> error<a class="anchor" aria-label="anchor" href="#error"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>The statistical error in a linear model is how much an observation's value differs from the (typically unobserved) true value of a population parameter.</dfn></p>
<p>It is closely related to the notion of a <a href="r.html#residual">residual</a>, except that it reflects deflection from the (usually unknown) <strong>true</strong> value as opposed to an <strong>estimate</strong> of the true value. It is usually only possible to know an observation's error if one is dealing with simulated data.</p>

</div>
<div id="escape" class="section level2" number="6.10">
<h2>
<span class="header-section-number">6.10</span> escape<a class="anchor" aria-label="anchor" href="#escape"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>Include special characters like " inside of a string by prefacing them with a backslash.</dfn></p>
<p>When you need to use a character that has a special meaning in R or markdown, you can create the <a href="l.html#literal">literal</a> version by escaping it with a backslash.</p>
<div class="sourceCode" id="cb100"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">str</span> <span class="op">&lt;-</span> <span class="st">"This prints a \"quote\" and prevents twitter handles like \\@psyteachr from turning into references."</span></code></pre></div>
<p>This prints a "quote" and prevents twitter handles like @psyteachr from turning into references.</p>

</div>
<div id="extension" class="section level2" number="6.11">
<h2>
<span class="header-section-number">6.11</span> extension<a class="anchor" aria-label="anchor" href="#extension"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>The end part of a file name that tells you what type of file it is (e.g., .R or .Rmd).</dfn></p>
<p>Common file types and their extensions</p>
<div class="inline-table"><table class="table table-sm">
<thead><tr class="header">
<th align="left">File type</th>
<th align="left">extension</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">R script</td>
<td align="left">.R</td>
</tr>
<tr class="even">
<td align="left">R Markdown</td>
<td align="left">.Rmd</td>
</tr>
<tr class="odd">
<td align="left">Comma-separated variable</td>
<td align="left">.csv</td>
</tr>
<tr class="even">
<td align="left">Plain text</td>
<td align="left">.txt</td>
</tr>
<tr class="odd">
<td align="left">Web file</td>
<td align="left">.html</td>
</tr>
<tr class="even">
<td align="left">Word document</td>
<td align="left">.doc, .docx</td>
</tr>
<tr class="odd">
<td align="left">PDF</td>
<td align="left">.pdf</td>
</tr>
</tbody>
</table></div>
</div>
<div id="extract-operator" class="section level2" number="6.12">
<h2>
<span class="header-section-number">6.12</span> extract operator<a class="anchor" aria-label="anchor" href="#extract-operator"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A symbol used to get values from a <a href="c.html#container">container</a> object, such as <code>[</code>, <code>[[</code>, or <code>$</code></dfn></p>
<p>You can extract values from a <a href="v.html#vector">vector</a> by <a href="i.html#index">index</a> or name using <code>[</code> and <code>[[</code>.</p>
<div class="sourceCode" id="cb101"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">my_vector</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span>A <span class="op">=</span> <span class="st">"first"</span>, B <span class="op">=</span> <span class="st">"second"</span><span class="op">)</span>
<span class="va">my_vector</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span>   <span class="co"># by index, retains name</span>
<span class="co">#&gt;       A </span>
<span class="co">#&gt; "first"</span>
<span class="va">my_vector</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span> <span class="co"># by index, removes name</span>
<span class="co">#&gt; [1] "first"</span>
<span class="va">my_vector</span><span class="op">[</span><span class="st">"B"</span><span class="op">]</span> <span class="co"># by name, retains name</span>
<span class="co">#&gt;        B </span>
<span class="co">#&gt; "second"</span>
<span class="va">my_vector</span><span class="op">[[</span><span class="st">"B"</span><span class="op">]</span><span class="op">]</span> <span class="co"># by name, removes name</span>
<span class="co">#&gt; [1] "second"</span></code></pre></div>
<p>You can extract values from a <a href="l.html#list">list</a> by <a href="i.html#index">index</a> or name using <code>[</code> and <code>[[</code> and by name using <code>$</code>.</p>
<div class="sourceCode" id="cb102"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">my_list</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span>
  A <span class="op">=</span> <span class="st">"First item"</span>,
  B <span class="op">=</span> <span class="fl">2</span>
<span class="op">)</span>

<span class="va">my_list</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span>     <span class="co"># by index, returns a (named) list </span>
<span class="co">#&gt; $A</span>
<span class="co">#&gt; [1] "First item"</span>
<span class="va">my_list</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span>   <span class="co"># by index, returns an (unnamed) vector</span>
<span class="co">#&gt; [1] "First item"</span>
<span class="va">my_list</span><span class="op">[</span><span class="st">"B"</span><span class="op">]</span>   <span class="co"># by name, returns a (named) list </span>
<span class="co">#&gt; $B</span>
<span class="co">#&gt; [1] 2</span>
<span class="va">my_list</span><span class="op">[[</span><span class="st">"B"</span><span class="op">]</span><span class="op">]</span> <span class="co"># by name, returns an (unnamed) vector</span>
<span class="co">#&gt; [1] 2</span>
<span class="va">my_list</span><span class="op">$</span><span class="va">A</span>      <span class="co"># by name, returns an (unnamed) vector</span>
<span class="co">#&gt; [1] "First item"</span></code></pre></div>

</div>
</div>
<script>

/* update total correct if #webex-total_correct exists */
update_total_correct = function() {
  console.log("webex: update total_correct");

  if (t = document.getElementById("webex-total_correct")) {
    var correct = document.getElementsByClassName("webex-correct").length;
    var solvemes = document.getElementsByClassName("webex-solveme").length;
    var radiogroups = document.getElementsByClassName("webex-radiogroup").length;
    var selects = document.getElementsByClassName("webex-select").length;
    
    t.innerHTML = correct + " of " + (solvemes + radiogroups + selects) + " correct";
  }
}

/* webex-solution button toggling function */
b_func = function() {
  console.log("webex: toggle hide");
  
  var cl = this.parentElement.classList;
  if (cl.contains('open')) {
    cl.remove("open");
  } else {
    cl.add("open");
  }
}

/* function for checking solveme answers */
solveme_func = function(e) {
  console.log("webex: check solveme");

  var real_answers = JSON.parse(this.dataset.answer);
  var my_answer = this.value;
  var cl = this.classList;
  if (cl.contains("ignorecase")) {
    my_answer = my_answer.toLowerCase();
  }
  if (cl.contains("nospaces")) {
    my_answer = my_answer.replace(/ /g, "")
  }

  if (my_answer == "") {
    cl.remove("webex-correct");
    cl.remove("webex-incorrect");
  } else if (real_answers.includes(my_answer)) {
    cl.add("webex-correct");
    cl.remove("webex-incorrect");
  } else {
    cl.add("webex-incorrect");
    cl.remove("webex-correct");
  }

  // match numeric answers within a specified tolerance
  if(this.dataset.tol > 0){
    var tol = JSON.parse(this.dataset.tol);
    var matches = real_answers.map(x => Math.abs(x - my_answer) < tol)
    if (matches.reduce((a, b) => a + b, 0) > 0) {
      cl.add("webex-correct");
    } else {
      cl.remove("webex-correct");
    }
  }

  // added regex bit
  if (cl.contains("regex")){
    answer_regex = RegExp(real_answers.join("|"))
    if (answer_regex.test(my_answer)) {
      cl.add("webex-correct");
    }
  }

  update_total_correct();
}

/* function for checking select answers */
select_func = function(e) {
  console.log("webex: check select");
  
  var cl = this.classList
  
  /* add style */
  cl.remove("webex-incorrect");
  cl.remove("webex-correct");
  if (this.value == "answer") {
    cl.add("webex-correct");
  } else if (this.value != "blank") {
    cl.add("webex-incorrect");
  }
  
  update_total_correct();
}

/* function for checking radiogroups answers */
radiogroups_func = function(e) {
  console.log("webex: check radiogroups");

  var checked_button = document.querySelector('input[name=' + this.id + ']:checked');
  var cl = checked_button.parentElement.classList;
  var labels = checked_button.parentElement.parentElement.children;
  
  /* get rid of styles */
  for (i = 0; i < labels.length; i++) {
    labels[i].classList.remove("webex-incorrect");
    labels[i].classList.remove("webex-correct");
  }
  
  /* add style */
  if (checked_button.value == "answer") {
    cl.add("webex-correct");
  } else {
    cl.add("webex-incorrect");
  }
  
  update_total_correct();
}

window.onload = function() {
  console.log("onload");
  /* set up solution buttons */
  var buttons = document.getElementsByTagName("button");

  for (var i = 0; i < buttons.length; i++) {
    if (buttons[i].parentElement.classList.contains('webex-solution')) {
      buttons[i].onclick = b_func;
    }
  }

  /* set up webex-solveme inputs */
  var solveme = document.getElementsByClassName("webex-solveme");

  for (var i = 0; i < solveme.length; i++) {
    /* make sure input boxes don't auto-anything */
    solveme[i].setAttribute("autocomplete","off");
    solveme[i].setAttribute("autocorrect", "off");
    solveme[i].setAttribute("autocapitalize", "off");
    solveme[i].setAttribute("spellcheck", "false");
    solveme[i].value = "";

    /* adjust answer for ignorecase or nospaces */
    var cl = solveme[i].classList;
    var real_answer = solveme[i].dataset.answer;
    if (cl.contains("ignorecase")) {
      real_answer = real_answer.toLowerCase();
    }
    if (cl.contains("nospaces")) {
      real_answer = real_answer.replace(/ /g, "");
    }
    solveme[i].dataset.answer = real_answer;

    /* attach checking function */
    solveme[i].onkeyup = solveme_func;
    solveme[i].onchange = solveme_func;
  }
  
  /* set up radiogroups */
  var radiogroups = document.getElementsByClassName("webex-radiogroup");
  for (var i = 0; i < radiogroups.length; i++) {
    radiogroups[i].onchange = radiogroups_func;
  }
  
  /* set up selects */
  var selects = document.getElementsByClassName("webex-select");
  for (var i = 0; i < selects.length; i++) {
    selects[i].onchange = select_func;
  }

  update_total_correct();
}

</script><script>
$( document ).ready(function() {
  var cite = ' ';
  var psyteachr = ' <a href="https://psyteachr.github.io/"><img src="images/logos/psyteachr_logo.png" style="height: 31px; color: white;" alt="psyTeachR: Reproducible Research" /></a>';
  var license = ' <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/" target="blank"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"></a>';

  $("footer div.row div:eq(1) p").html(
    psyteachr + license + cite
  );
  
  $("#toc").appendTo($("#main-nav"));
});
</script><div class="chapter-nav">
<div class="prev"><a href="d.html"><span class="header-section-number">5</span> D</a></div>
<div class="next"><a href="f.html"><span class="header-section-number">7</span> F</a></div>
</div></main><div class="col-md-3 col-lg-2 d-none d-md-block sidebar sidebar-chapter">
    <nav id="toc" data-toggle="toc" aria-label="On this page"><h2>On this page</h2>
      <ul class="nav navbar-nav">
<li><a class="nav-link" href="#e"><span class="header-section-number">6</span> E</a></li>
<li><a class="nav-link" href="#effect-code"><span class="header-section-number">6.1</span> effect code</a></li>
<li><a class="nav-link" href="#effect-size"><span class="header-section-number">6.2</span> effect size</a></li>
<li><a class="nav-link" href="#effect"><span class="header-section-number">6.3</span> effect</a></li>
<li><a class="nav-link" href="#element"><span class="header-section-number">6.4</span> element</a></li>
<li><a class="nav-link" href="#element-html"><span class="header-section-number">6.5</span> element (html)</a></li>
<li><a class="nav-link" href="#ellipsis"><span class="header-section-number">6.6</span> ellipsis</a></li>
<li><a class="nav-link" href="#environment"><span class="header-section-number">6.7</span> environment</a></li>
<li><a class="nav-link" href="#error-term"><span class="header-section-number">6.8</span> error term</a></li>
<li><a class="nav-link" href="#error"><span class="header-section-number">6.9</span> error</a></li>
<li><a class="nav-link" href="#escape"><span class="header-section-number">6.10</span> escape</a></li>
<li><a class="nav-link" href="#extension"><span class="header-section-number">6.11</span> extension</a></li>
<li><a class="nav-link" href="#extract-operator"><span class="header-section-number">6.12</span> extract operator</a></li>
</ul>

      <div class="book-extra">
        <ul class="list-unstyled">
<li><a id="book-source" href="https://github.com/psyteachr/glossary/blob/master/terms/e.Rmd">View source <i class="fab fa-github"></i></a></li>
          <li><a id="book-edit" href="https://github.com/psyteachr/glossary/edit/master/terms/e.Rmd">Edit this page <i class="fab fa-github"></i></a></li>
        </ul>
</div>
    </nav>
</div>

</div>
</div> <!-- .container -->

<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

  <div class="col-12 col-md-6 mt-3">
    <p>"<strong>Glossary</strong>" was written by psyTeachR Team. It was last built on 2022-02-27.</p>
  </div>

  <div class="col-12 col-md-6 mt-3">
    <p>This book was built by the <a class="text-light" href="https://bookdown.org">bookdown</a> R package.</p>
  </div>

</div></div>
</footer><!-- dynamically load mathjax for compatibility with self-contained --><script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    var src = "true";
    if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML";
    if (location.protocol !== "file:")
      if (/^https?:/.test(src))
        src = src.replace(/^https?:/, '');
    script.src = src;
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script><script type="text/x-mathjax-config">const popovers = document.querySelectorAll('a.footnote-ref[data-toggle="popover"]');
for (let popover of popovers) {
  const div = document.createElement('div');
  div.setAttribute('style', 'position: absolute; top: 0, left:0; width:0, height:0, overflow: hidden; visibility: hidden;');
  div.innerHTML = popover.getAttribute('data-content');

  var has_math = div.querySelector("span.math");
  if (has_math) {
    document.body.appendChild(div);
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, div]);
    MathJax.Hub.Queue(function() {
      popover.setAttribute('data-content', div.innerHTML);
      document.body.removeChild(div);
    })
  }
}
</script>
</body>
</html>
